<template>
	<view class="tabbar">
		<u-tabbar
			:value="current"
			@change="chang"
			:fixed="true"
			:placeholder="true"
			:safeAreaInsetBottom="true"
		>
			<u-tabbar-item v-for="(item,index) in list" :key="index" :text="item.text" :icon="item.icon"></u-tabbar-item>
		</u-tabbar>
	</view>
</template>
<script>
export default {
  data() {
    return {
			list:[
				// {text:"壁纸",icon:"photo",path:"/pages/home/index"},
        {text:"壁纸",icon:"photo",path:"/pages/index/index"},
				{text:"笔记",icon:"bookmark",path:"/pages/note/index"},
				{text:"我的",icon:"account",path:"/pages/user/user"},
			]
    };
  },
	props:{
		current:{
			type:Number,
			default:0
		}
	},
  methods:{
		chang(index){
			uni.switchTab({
				url:this.list[index].path
			})
			this.value = index
		}
	},
};
</script>
<style lang="scss" scoped>
.tabbar{
	position: fixed;
}
   .u-page {
   		padding: 0;
   
   		&__item {
   
   			&__title {
   				color: $u-tips-color;
   				background-color: $u-bg-color;
   				padding: 15px;
   				font-size: 15px;
   
   				&__slot-title {
   					color: $u-primary;
   					font-size: 14px;
   				}
   			}
   
   			&__slot-icon {
   				width: 17px;
   				height: 17px;
   			}
   		}
   	}
</style>